package cn.cyh.queue_service.common;

/**
 * 系统常量类
 */
public class Constants {

    /**
     * 默认页码
     */
    public static final int DEFAULT_PAGE_NUMBER = 1;

    /**
     * 默认页大小
     */
    public static final int DEFAULT_PAGE_SIZE = 10;

    /**
     * 最大页大小
     */
    public static final int MAX_PAGE_SIZE = 100;
    
    /**
     * 默认头像地址
     */
    public static final String DEFAULT_AVATAR = "https://cube.elemecdn.com/3/7c/3ea6beec64369c2642b92c6726f1epng.png";
    
    /**
     * 管理员角色
     */
    public static final String ROLE_ADMIN = "ROLE_ADMIN";
    
    /**
     * 操作员角色
     */
    public static final String ROLE_OPERATOR = "ROLE_OPERATOR";
    
    /**
     * 超级管理员角色
     */
    public static final String ROLE_SUPER_ADMIN = "ROLE_SUPER_ADMIN";

    /**
     * Redis键前缀
     */
    public static class RedisKey {
        /**
         * 用户信息前缀
         */
        public static final String USER_PREFIX = "user:";

        /**
         * 业务类型前缀
         */
        public static final String BUSINESS_TYPE_PREFIX = "business_type:";

        /**
         * 窗口信息前缀
         */
        public static final String WINDOW_PREFIX = "window:";

        /**
         * 队列信息前缀
         */
        public static final String QUEUE_PREFIX = "queue:";

        /**
         * 排队信息前缀
         */
        public static final String QUEUE_INFO_PREFIX = "queue_info:";

        /**
         * 统计数据前缀
         */
        public static final String STATISTICS_PREFIX = "statistics:";
        
        /**
         * 人脸信息前缀
         */
        public static final String FACE_PREFIX = "face:";
        
        /**
         * 黑名单前缀
         */
        public static final String BLACKLIST_PREFIX = "blacklist:";
        
        /**
         * 锁前缀
         */
        public static final String LOCK_PREFIX = "lock:";
    }

    /**
     * 业务状态
     */
    public static class BusinessStatus {
        /**
         * 禁用
         */
        public static final int DISABLED = 0;

        /**
         * 启用
         */
        public static final int ENABLED = 1;
    }

    /**
     * 队列状态
     */
    public static class QueueStatus {
        /**
         * 等待中
         */
        public static final int WAITING = 0;

        /**
         * 已叫号
         */
        public static final int CALLED = 1;

        /**
         * 已处理
         */
        public static final int PROCESSED = 2;

        /**
         * 已取消
         */
        public static final int CANCELLED = 3;

        /**
         * 未到场
         */
        public static final int ABSENT = 4;
    }

    /**
     * 窗口状态
     */
    public static class WindowStatus {
        /**
         * 关闭
         */
        public static final int CLOSED = 0;

        /**
         * 开放
         */
        public static final int OPEN = 1;

        /**
         * 暂停
         */
        public static final int PAUSE = 2;
    }

    /**
     * 用户角色
     */
    public static class UserRole {
        /**
         * 管理员
         */
        public static final String ADMIN = "ROLE_ADMIN";

        /**
         * 窗口操作员
         */
        public static final String OPERATOR = "ROLE_OPERATOR";
        
        /**
         * 统计分析员
         */
        public static final String ANALYST = "ROLE_ANALYST";
    }
    
    /**
     * 删除标识
     */
    public static class DeleteFlag {
        /**
         * 未删除
         */
        public static final int NOT_DELETED = 0;
        
        /**
         * 已删除
         */
        public static final int DELETED = 1;
    }
    
    /**
     * WebSocket消息类型
     */
    public static class WebSocketMessageType {
        /**
         * 叫号消息
         */
        public static final String CALL_MESSAGE = "call";
        
        /**
         * 状态更新消息
         */
        public static final String STATUS_UPDATE = "status_update";
        
        /**
         * 队列更新消息
         */
        public static final String QUEUE_UPDATE = "queue_update";
    }
    
    /**
     * MQ常量
     */
    public static class MQConstants {
        /**
         * 交换机
         */
        public static final String EXCHANGE_DIRECT = "queue_service.direct";
        
        /**
         * 叫号路由键
         */
        public static final String ROUTING_KEY_CALL = "queue.call";
        
        /**
         * 取号路由键
         */
        public static final String ROUTING_KEY_TAKE_NUMBER = "queue.take";
        
        /**
         * 状态更新路由键
         */
        public static final String ROUTING_KEY_STATUS_UPDATE = "queue.status";
        
        /**
         * 验证路由键
         */
        public static final String ROUTING_KEY_VERIFY = "queue.verify";
        
        /**
         * 完成服务路由键
         */
        public static final String ROUTING_KEY_COMPLETE = "queue.complete";
        
        /**
         * 统计更新路由键
         */
        public static final String ROUTING_KEY_STATS_UPDATE = "queue.stats";
        
        /**
         * 叫号队列
         */
        public static final String QUEUE_CALL = "queue.call";
        
        /**
         * 取号队列
         */
        public static final String QUEUE_TAKE_NUMBER = "queue.take";
        
        /**
         * 状态更新队列
         */
        public static final String QUEUE_STATUS_UPDATE = "queue.status";
        
        /**
         * 验证队列
         */
        public static final String QUEUE_VERIFY = "queue.verify";
        
        /**
         * 完成服务队列
         */
        public static final String QUEUE_COMPLETE = "queue.complete";
        
        /**
         * 统计更新队列
         */
        public static final String QUEUE_STATS_UPDATE = "queue.stats";
    }
} 